package com.bootlever.framework.redis.properties;

import com.bootlever.framework.redis.cfg.BootLeverJedisPoolConfig;
import com.bootlever.framework.redis.cfg.BootLeverRedissonConfig;
import com.bootlever.framework.redis.constant.EnumRedisType;
import org.redisson.config.Config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "bootlever.framework.redis")
public class RedisProperties {

    private String type = EnumRedisType.SINGLETON.getType();//模式
    private String nodes;
    private String password;
    private String address = "127.0.0.1:6379";
    private int database = 0;
    private String master;
    private int timeout = 3000;
    private String clientName;

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    public String getMaster() {
        return master;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    public String getNodes() {
        return nodes;
    }

    public void setNodes(String nodes) {
        this.nodes = nodes;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getDatabase() {
        return database;
    }

    public void setDatabase(int database) {
        this.database = database;
    }

    private BootLeverJedisPoolConfig jedis = new BootLeverJedisPoolConfig();

    private BootLeverRedissonConfig redisson = new BootLeverRedissonConfig();

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BootLeverRedissonConfig getRedisson() {
        return redisson;
    }

    public void setRedisson(BootLeverRedissonConfig redisson) {
        this.redisson = redisson;
    }

    public BootLeverJedisPoolConfig getJedis() {
        return jedis;
    }

    public void setJedis(BootLeverJedisPoolConfig jedis) {
        this.jedis = jedis;
    }
}
